package com.example.demo.job;

import com.example.demo.entity.User;
import com.example.demo.mapper.UserMapper;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MyQuartzJob2 implements Job {
    
    @Autowired
    private UserMapper userMapper;
    
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        try {
            // 创建用户数据示例
            
            System.out.println("定时任务执行成功：插入用户数据 " );
        } catch (Exception e) {
            System.out.println("定时任务执行失败：" + e.getMessage());
            throw new JobExecutionException(e);
        }
    }
} 